{template 'common/header'}
<link rel="stylesheet" href="../addons/kuyuan_fm/dist/web/common.css" />
<link rel="stylesheet" href="../addons/kuyuan_fm/dist/web/edit-goods.css" />
<div id="louie" data-url="{php echo $this->createWebUrl('api')}" data-goods-id="{php echo $_GPC['goods_id'] ? $_GPC['goods_id'] : 0}">

    <!--S头部-->
    <div id="header">
        <h2>
            <i class="iconfont icon-shangjiatubiaoqueren-"></i>
            <template v-if="goods_id == '0'">添加商品</template>
            <template v-else>修改商品</template>
        </h2>
        <a class="btn btn-info handel-btn" href="{php echo $this->createWebUrl('goods')}">商品列表</a>
    </div>
    <!--E头部-->

    <!--S商品表单-->
    <form ref="form" action="" method="post" v-on:submit.prevent="submit">

        <div class="form-group">
            <label>商品名称</label>
            <input type="text" v-model.trim="name" class="form-control" placeholder="商品名称" />
        </div>

        <div class="form-group min price">
            <label>商品兑换价格</label>
            <div class="input-group">
                <input type="text" v-model.trim="price" class="form-control" placeholder="兑换价格" />
                <div class="input-group-addon">{{setting.currency_name}}</div>
            </div>
        </div>

        <div class="form-group min">
            <label>排序权重</label>
            <input type="text" v-model.trim="weight" class="form-control" placeholder="排序权重" />
        </div>

        <div class="form-group min">
            <label>库存数量</label>
            <input type="text" v-model.trim="inventory" class="form-control" placeholder="库存数量" />
        </div>

        <div class="form-group min">
            <label>销量</label>
            <input type="text" v-model.trim="sales" class="form-control" placeholder="销量" />
        </div>

        <div class="form-group min">
            <label>是否上架</label>
            <select v-model="status" class="form-control">
                <option value="1">是</option>
                <option value="2">否</option>
            </select>
        </div>

        <div ref="images" class="form-group" style="clear:both;">
            <label>商品图片</label>
            {php echo tpl_form_field_multi_image("images",$_images)}
        </div>

        <div class="form-group">
            <label>商品详情</label>
            <div ref="detail"></div>
        </div>

        <button class="btn btn-primary" type="submit">
            <template v-if="goods_id == '0'">确认添加</template>
            <template v-else>确认修改</template>
        </button>
    </form>
    <!--E商品表单-->

    <!--提示框--><v-dialog style="z-index:99999999;"/>
</div>
<script src="../addons/kuyuan_fm/dist/web/common.js"></script>
<script src="../addons/kuyuan_fm/dist/web/edit-goods.js"></script>
{template 'common/footer'}